<template>
  <div class="order-ycspace-structure-view">
    <el-table
      :data="tableData"
      style="width: 100%;margin-bottom: 20px;"
      row-key="id"
      border
      :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
    >
      <el-table-column prop="date" label="空间名称" />
      <el-table-column prop="name" label="空间主" />
      <el-table-column prop="address" label="空间主手机号码" />
      <el-table-column prop="address" label="团队数量" />
      <el-table-column prop="address" label="会员数量" />
      <el-table-column fixed="right" label="操作" width="160">
        <template slot-scope="scope">
          <el-button type="text" size="small">编辑</el-button>
          <el-button type="text" size="small" @click="handleClick(scope.row)">
            禁用全部用户
          </el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'SpaceTeam',

  data() {
    return {
      tableData: [
        {
          id: 3,
          date: '赜隐',
          name: '王小虎',
          address: '13899990000',
          children: [
            {
              id: 31,
              date: '赜隐',
              name: '王小虎',
              address: '13899990000',
              children: [
                {
                  id: 311,
                  date: '赜隐',
                  name: '王小虎',
                  address: '13899990000'
                },
                {
                  id: 321,
                  date: '赜隐',
                  name: '王小虎',
                  address: '13899990000'
                }
              ]
            },
            {
              id: 32,
              date: '赜隐',
              name: '王小虎',
              address: '13899990000'
            }
          ]
        },
        {
          id: 4,
          date: '赜隐',
          name: '王小虎',
          address: '13899990000'
        }
      ]
    }
  },

  computed: {
    columns() {
      return [
        {
          label: '空间名',
          prop: 'id',
          search: 'input'
        },
        {
          label: '查询时间',
          prop: 'id',
          search: 'date'
        },
        {
          label: '团队长',
          prop: 'id',
          width: '80'
        },
        {
          label: '团队长手机号码',
          prop: 'author'
        },
        {
          label: '营业额',
          prop: 'display_time'
        },
        {
          label: '预计直推奖励',
          prop: 'display_time'
        },
        {
          label: '预计业绩奖励',
          prop: 'display_time'
        },
        {
          label: '预计奖励合计',
          prop: 'display_time'
        },
        {
          label: '会员数',
          prop: 'display_time'
        },
        {
          label: '实际交易会员',
          prop: 'display_time'
        },
        {
          label: '交易作品',
          prop: 'display_time'
        },
        {
          label: '抢购1件（人）',
          prop: 'display_time'
        },
        {
          label: '抢购2件（人）',
          prop: 'display_time'
        },
        {
          label: '抢购3件（人）',
          prop: 'display_time'
        },
        {
          label: '抢购4件（人）',
          prop: 'display_time'
        },
        {
          label: '抢购5件（人）',
          prop: 'display_time'
        }
      ]
    }
  },

  beforeMount() {
    // console.log('asd')
  },

  methods: {
    test(data) {
      console.log('data')

      console.log(data)
    }
  }
}
</script>

<style lang="scss">
@import './index';
</style>
